Release 10.1A: OpenEdge Development:
Web Services
Common procedure for SOAP fault handling
The examples
StockQuotes.pandDataFormats.pshare a common procedure (using their own physical code copies) for handling SOAP faults. This works because the possible information that can be received for a SOAP fault is essentially the same for all Web services. You can, of course, design such a procedure differently to manage the error information and present it to the user. However, just about any design that you choose can work with any Web service.This is the procedure that both procedures call to handle all errors, including SOAP faults (modified to include numeric step comments that are referenced by the following description):
This code:
- Determines whether an error has occurred from the value of the
OUTPUTparameter, which is set toTRUEif error messages exist. Each example procedure callsErrorInfoafter invoking a Web service operation. For example:
If an error occurs,
ErrorInfohas already processed the error information in expectation that no normal results are available from the operation to process.- After displaying all the available error messages,
ErrorInfoverifies that a SOAP fault caused the error by checking if a SOAP fault object is part of the error status (ERROR-STATUS:ERROR-OBJECT-DETAILreferences it).- After displaying the basic SOAP fault information,
ErrorInfofurther verifies that there is SOAP fault detail information by checking if a SOAP fault-detail object is part of the SOAP fault object data (hSOAPFault:SOAP-FAULT-DETAILreferences it) and displays any SOAP fault detail information that it references.Note also that the error processing in
ErrorInfois essentially identical to the error processing in theTemperatureSample.pprocedure, which could be easily rewritten to call it.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |